﻿<%@ Page Language="C#"  MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.MailMessage" Title="" StylesheetTheme="SkinFile" Codebehind="MailMessage.aspx.cs" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadPlaceHolder">
    <script language="javascript" type="text/javascript">
        function OpenSpamDiv() {
            $("#OpenSpamDivbutton").hide();
            $("#SpamDiv").fadeIn(100);             
        }

    </script>
</asp:Content>

<asp:Content ID="PageNameContent" ContentPlaceHolderID="PageNamePlaceHolder" runat="server">
    <asp:Label ID="PageNameLabel" runat="server" Text="<%$ Resources:Resource, MailMessage_PageNameLabel %>" CssClass="PageNameContentStyle"></asp:Label>
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:HiddenField ID="MessageIdHiddenField" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
    <asp:Panel ID="MessagePanel" runat="server" Visible="false">
    <div class="basic_element">
        <asp:Label ID="MessageLabel" runat="server" SkinID="GreenSmallHeaderLabel"></asp:Label>
    </div>
    </asp:Panel>
    
    <asp:FormView ID="FormView1" runat="server" DataSourceID="GetMailSqlDataSource" Width="100%">
        <ItemTemplate>
            <div class="basic_element">
            <div class="red_title">
                <asp:Label ID="SubjectTitleLabel" runat="server" Text='<%# Resources.Resource.Global_Subject+ ":"%>' CssClass="white_title"></asp:Label>
                <asp:Label ID="Label2" runat="server" Text='<%# Eval("[Subject]") %>' CssClass="white_title" />
            </div>
            <div class="padding5">

                <asp:Label ID="SentTitleLabel" runat="server" Text="<%$ Resources:Resource, MailMessage_SentTitleLabel %>" SkinID="InfoLabel"></asp:Label>
                <asp:Label ID="DateLabel" runat="server" Text='<%# Eval("[Date]") %>' SkinID="ForumTextLabel" />
                <br />
                <asp:Label ID="FromLabel" runat="server" Text='<%# Resources.Resource.Global_From+ ":"%>' SkinID="InfoLabel"></asp:Label>
                <asp:Hyperlink ID="LinkButton1" runat="server" Text='<%# Bind("From") %>' NavigateUrl='<%# Eval("FromId", "UserPage.aspx?Id={0}") %>'
                    SkinID="GreenTitleHyperLink"></asp:Hyperlink>
                <br />
                <asp:Label ID="ToLabel" runat="server" Text='<%# Resources.Resource.Global_To+ ":"%>' SkinID="InfoLabel"></asp:Label>
                <asp:Hyperlink ID="LinkButton2" runat="server" Text='<%# Bind("To") %>' NavigateUrl='<%# Eval("ToId", "UserPage.aspx?Id={0}") %>'
                    SkinID="GreenTitleHyperLink"></asp:Hyperlink>
                <br />
                <asp:HyperLink ID="NextMessageHyperlink" runat="server" NavigateUrl='<%# "~/MailMessage.aspx?MailId=" + Eval("NextMailId") %>'
                    Text="<%$ Resources:Resource, Global_Next %>" SkinID="BlackHyperLinkSkin" Visible='<%# (Eval("NextMailId").ToString() != "0") %>' ></asp:HyperLink>
                <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "~/MailMessage.aspx?MailId=" + Eval("PrevMailId") %>'
                    Text="<%$ Resources:Resource, Global_Previous %>" SkinID="BlackHyperLinkSkin" Visible='<%# (Eval("PrevMailId").ToString() != "0") %>' ></asp:HyperLink>
                        
                    
                <hr />
                <%--<asp:Label ID="Label4" runat="server" Text='<%# ReturnConvertedForumString(Eval("Body"))%>' SkinID="GridLabel"/>--%>
                <asp:Label ID="Label1" runat="server" Text='<%# MailBody(Eval("Body")) %>' SkinID="GridLabel"/>
                <hr />
                <br />
            
                <asp:Button ID="ReplyButton" runat="server" Text="<%$ Resources:Resource, MailMessage_ReplyButton %>" PostBackUrl='<%# Eval("FromId", "ComposeMail.aspx?ToId={0}&Subject="+Eval("Subject")+"&IsReplyTo="+Eval("MailId")) %>'
                 CssClass="GreenSmallButtonStyle" Visible='<%# LoggedInIsReciver(Eval("ToId"))%>' />
                &nbsp;
                <asp:Button ID="DeleteButton" runat="server" Text="<%$ Resources:Resource, Global_Delete %>" 
                 Message="<%$ Resources:Resource, Global_Delete %>"
                 OnClick="DeleteMessage" OnClientClick='return confirm(this.getAttribute("Message"))'
                 CssClass="GreySmallButtonStyle"  Visible='<%# LoggedInIsReciver(Eval("ToId"))%>' />
                <br />
                <asp:Panel ID="ReportSpamPanel" runat="server" Visible='<%# Eval("ReportSpamVisible") %>'>
                <div id="OpenSpamDivbutton">
                    <br />
                    <asp:LinkButton ID="OpenSpamReportAreaButton" runat="server" Text="<%$ Resources:Resource, MailMessage_ReportSpamText %>" SkinID="GreenTitleLink"
                        OnClientClick="OpenSpamDiv(); return false;" ></asp:LinkButton>
                    </div>
                <div id="SpamDiv" style="display:none;">
                    <br />
                    <asp:Label ID="SpamNoteTitle" runat="server" SkinID="InfoLabel" Text="<%$ Resources:Resource, Mail_ReportNoteExplanation %>"></asp:Label>
                    <br />
                    <CustomControls:TextArea ID="NopeTextArea" runat="server" MaxLength="800" TextMode="MultiLine" Rows="3" Height="150" Width="350" ></CustomControls:TextArea>
                    <br />
                    <asp:Button ID="SubmitSpamButton" runat="server" CssClass="GreenSmallButtonStyle" OnClick="SubmitSpamReport" Text="<%$ Resources:Resource, Global_Submit %>" />
                    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                        <ProgressTemplate>
                            <div class="ajaxloader">
                                <asp:Image ID="ProgressImage1" runat="server" ImageUrl="~/Images/ajax-loader.gif" />
                            </div>
                        </ProgressTemplate>
                    </asp:UpdateProgress>
                </div>
                </asp:Panel>
                <asp:Panel ID="RemoveSpamReportPanel" runat="server" Visible='<%# Eval("RemoveSpamReportVisible") %>'>
                    <br />
                    <asp:Label ID="MarkedAsSpam" runat="server" Text="<%$ Resources:Resource, Mail_MarkedAsSpam %>" SkinID="InfoLabel"></asp:Label>
                    <br />
                    <asp:Label ID="SpamNoteByReceiver" runat="server" Text='<%# Eval("SpamReportNoteByReceiver") %>' SkinID="GridLabel"></asp:Label>
                    <br /><br />
                    <asp:Button ID="DeleteSpamReport" runat="server" Text="<%$ Resources:Resource, Mail_CancelSpamReport %>" CssClass="GreenSmallButtonStyle" OnClick="CancelSpamReport" />
                </asp:Panel>
                <br />
                <asp:Label ID="HistoryLabel" runat="server" SkinID="GridLabel" ></asp:Label>
                <br /><br />
                <asp:HyperLink ID="InboxHyperlink" runat="server" SkinID="GreenTitleHyperLink" 
                NavigateUrl="~/MailInbox.aspx" Text="<%$ Resources:Resource, Global_Inbox %>"></asp:HyperLink>
            </div>
            </div>
            
        </ItemTemplate>
    </asp:FormView>
    <asp:SqlDataSource ID="GetMailSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
        SelectCommand="Nivdal_MailGetMail" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
    </ContentTemplate>
    </asp:UpdatePanel>
    
</asp:Content>
